package com.aaa.system.controller;

import com.aaa.system.service.MenuService;
import com.aaa.entity.Menu;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author Lei
 * @create 2023-03-20 17:02
 */
@RestController
@RequestMapping("system/menu")
public class MenuController {

    @Autowired
    private MenuService menuService;

    /**
     * 根据用户id查找登录用户信息
     * @param userId  用户id
     * @return 查找结果信息
     */
    @GetMapping("findByUserid/{userId}")
    public List<Menu> findByUserid(@PathVariable Long userId){
        return menuService.findByUserid(userId);
    }

}
